# # _*_ coding: UTF-8 _*_
# # @Time     : 2021/10/22 17:23
# # @Author   : yangshuaishuai
# # @Site     : http://www.hzdledu.cn/
# # @File     : practice3.py
# # @Software : PyCharm

# # 4.打印以下图形
# # * * * * *
# # * * * *
# # * * *
# # * *
# # *
# for i in range(5):
#     for j in range(5-i):
#         print('*',end='')
#     print()
#
# # 5.打印以下图形
# # * * * * *
# #   * * * *
# #     * * *
# #       * *
# #         *
# for i in range(5):
#     for j in range(i):
#         print('',end='')
#     for k in range(5-i):
#         print('*',end='')
#     print()
#
# # 6.打印以下图形
# #         *
# #       * *
# #     * * *
# #   * * * *
# # * * * * *
# for i in range(5):
#     for j in range(5-i-1):
#         print('',end='')
#     for k in range(i+1):
#         print('*',end='')
#     print()
#
# # 7.打印以下图形
# #       *
# #     * * *
# #   * * * * *
# # * * * * * * *
# #   * * * * *
# #     * * *
# #       *
# for i in range(4):
#     for j in range(4-i-1):
#         print(' ',end=' ')
#     for k in range(2*i+1):
#         print('*',end=' ')
#     print()
# for i in range(3):
#     for j in range(i+1):
#         print(' ',end=' ')
#     for k in range(6 - 2 * (i+1)+1):
#         print('*',end=' ')
#     print()

# num = int(input('请输入数据:'))
# for i in range(num // 2 + 1):
#     for j in range(num // 2 + 1 - i - 1):
#         print(' ', end=' ')
#     for k in range(2 * i + 1):
#         print('*', end=' ')
#     print()
# for i in range(num // 2):
#     for j in range(i + 1):
#         print(' ', end=' ')
#     for k in range(num // 2 * 2 - 2 * (i + 1) + 1):
#         print('*', end=' ')
#     print()

# 8. 猜数字游戏，增加游戏次数限制，最多只能猜5次。如果5次都没猜正确，给出提示，游戏结束# import random
# import random
#
# num = random.randint(1, 10)
# for i in range(1, 6):
#     x = int(input('请输入数据:'))
#     if x == num:
#         print('恭喜你，答对了')
#         break
#     elif x < num:
#         print('小了')
#     elif x > num:
#         print('大了')
#     print('还有%s次' % (5 - i))
# print('游戏结束')
#
# # 1. 解决千年虫问题，以前的电脑为了节省存储空间，通常年份都是用的两位数字，这样跨过2000年后，
# # 2000年和1900都会被表示为00，造成计算机系统故障，编写程序将以下序列中1970后的年份转换为4位，并升序输出。
# # 当前序列:[89,98,00,75,68,37,58,90]
# # 输出序列:[1937,1958,1968,1975,1989,1990,1998,2000]
#
# list1 = [89, 98, 00, 75, 68, 37, 58, 90]
# for i in range(len(list1)):
#     if list[i] == 00:
#         list1[i] = 2000
#     else:
#         list[i] = 1900 + list1[i]
# list1.sort()
# print(list1)
